home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / grphwiz.dxr / 00157_scroll button.ls < prev    next >
Encoding:
Text File  |  2000-01-14  |  1.3 KB  |  50 lines

  1. property ancestor, pSlider, pIsIncreasing
  2.  
  3. on new me, buttonName, castName, theChannel, theStageLoc, Slider, isIncreasing, descendant
  4.   if objectp(descendant) then
  5.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, descendant)
  6.   else
  7.     ancestor = new(script("generic button"), buttonName, castName, theChannel, theStageLoc, me)
  8.   end if
  9.   pSlider = Slider
  10.   pIsIncreasing = isIncreasing
  11.   return me
  12. end
  13.  
  14. on trackMouse me
  15.   if not me.pIsDisabled then
  16.     flag = 0
  17.     repeat while the mouseDown
  18.       flag = 1
  19.       State = the memberNum of sprite me.pChannel
  20.       if rollOver(me.pChannel) then
  21.         set the member of sprite the pChannel of me to me.pDownState
  22.         performFunction(me._me)
  23.       else
  24.         set the member of sprite the pChannel of me to me.pUpState
  25.       end if
  26.       if not (State = the memberNum of sprite me.pChannel) then
  27.         updateStage()
  28.       end if
  29.     end repeat
  30.     set the member of sprite the pChannel of me to me.pUpState
  31.     updateStage()
  32.     if rollOver(me.pChannel) then
  33.       if not flag then
  34.         performFunction(me._me)
  35.       end if
  36.     end if
  37.   end if
  38.   return me
  39. end
  40.  
  41. on performFunction me
  42.   setting = getSetting(pSlider)
  43.   if pIsIncreasing then
  44.     setThumb(pSlider, setting + 1)
  45.   else
  46.     setThumb(pSlider, setting - 1)
  47.   end if
  48.   return me
  49. end
  50.